import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart';

class RectConverter implements JsonConverter<Rect, List<dynamic>> {
  const RectConverter();

  @override
  Rect fromJson(List<dynamic> json) => Rect.fromLTRB(json[0], json[1],json[2],json[3]);

  @override
  List<double> toJson(Rect object) => [object.left, object.top, object.right, object.bottom];
}